﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_quanlive : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        load();
    }
    Ve ve = new Ve();
    private void load()
    {
        
        ASPxGridView1.DataSource = ve.GetData();
        ASPxGridView1.DataBind();
    }
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {

        ve.DeleteVe(int.Parse(e.Values["mave"].ToString()));
        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        load();
    }
   
    protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        string mave = e.OldValues["mave"].ToString();
        string trangthai = e.NewValues["trangthai"].ToString();
        ve.UpdateTrangThaiVe(int.Parse(mave),trangthai);
        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        load();
    }
    
}